import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
// tslint:disable-next-line:ordered-imports
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
// tslint:disable-next-line: ordered-imports
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import show from '@dfeidao/atom-web/ui/show';
import p001 from './p001';

export default async function a001(fd: IFeidaoAiBrowserComponent) {
	// todo
		const de=fd.data.node.querySelector<HTMLDivElement>('[data-id="add"]');
	set_node_cls(de,'display-n',false);
	show(fd.data.node);
	const res=await nodejs<{dt: Array<{question_bank_type: string}>}>('question-bank/zj-000002/s001',{});
	const ret=new Array();
	for (let c=0;c < res.dt.length;c++) {
ret[c] = res.dt[c].question_bank_type;
	}
	// 数组去重
	 const set = new Set(ret);
	 const newArr = Array.from(set);
	 render(fd,newArr,p001,'p001','inner');

}
